<!--
 * @Author: jinjing
 * @Date: 2024-11-23
 * @Description: 基金信息。
 -->
<template>
  <div class="content">
    <el-table :data="tableData" style="width: 100%" v-loading="loading">
        <el-table-column prop="ticker" label="基金代码"/>
        <el-table-column prop="name" label="基金名称"/>
        <el-table-column prop="mgmt" label="基金管理人" />
        <el-table-column prop="custodian" label="基金托管人" />
        <el-table-column prop="incept dt" label="基金成立日" />
    </el-table>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import { getFundData } from '../duckdb.js'
import moment from 'moment'

const loading = ref(true)
const tableData = ref([])
const getData = async () => {
    loading.value = true
    let ans = await getFundData("select * from fund_desc")
    // 时间数据处理
    for (let row of ans) {
        let date = new Date(row['incept dt'])
        row['incept dt'] = moment(date).format('YYYY-MM-DD HH:mm:ss')
        tableData.value.push(row)
    }
    loading.value = false
    return tableData
}
await getData()


</script>

<style>

</style>